using Xamarin.Essentials;

namespace IntestableDemo {
    public class UserInfoStorage {
        private IPreferenceStorage _preferenceStorage;

        public UserInfoStorage(IPreferenceStorage preferenceStorage) {
            _preferenceStorage = preferenceStorage;
        }

        public void Save(UserInfo userInfo) {
            _preferenceStorage.Set(nameof(UserInfo.DisplayName),
                userInfo.DisplayName);
        }
    }
}